<script setup lang="ts">
import { type CSSProperties, computed } from "vue";
import { hasAuth, getAuths } from "@/router/utils";
defineOptions({
  name: "TestButton"
});
const elStyle = computed((): CSSProperties => {
  return {
    width: "85vw",
    justifyContent: "start"
  };
});
const aaaa = () => {
  alert('[[[[]]]]')
}
</script>
<template>
  <el-card shadow="never" :style="elStyle">
    <template #header>
      <div class="card-header">
        指令方式判断权限（该方式不能动态修改权限）
      </div>
    </template>
    <el-button type="success" v-auth="'btn_add'">
      拥有code：'btn_add' 权限可见
    </el-button>
    <el-button type="primary" v-auth="['btn_edit']">
      拥有code：['btn_edit'] 权限可见
    </el-button>
    <el-button type="danger" v-auth="['btn_delete']" @click="aaaa">
      拥有code：['btn_add', 'btn_edit', 'btn_delete'] 权限可见
    </el-button>

    <h1 v-auth="'test'">123</h1>
  </el-card>
</template>